<?php
namespace App\Service\Admin;

use App\Service\BaseService as Service;

class BaseService extends Service
{
    //基础服务

    //返回参数
    public function toback($code = 0, $msg = '', $data = [], $total = 0)
    {
        $msg = $msg ? $msg : 'success';
        return array('code' => $code, 'msg' => $msg, 'data' => $data, 'total' => $total);
    }

    //通过公司名称获取ID
    public function cidByCname($cname)
    {
        return $this->dbConn($this->dbCompany)->where('cname', $cname)->value('id');
    }
}